﻿using Md.Api.Model.Manage.SysUser.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.SysUser;
/// <summary>
/// 通过用户编号删除系统用户服务
/// </summary>
public class DeleteSysUserByUserIdService : ApiBase<RequestDeleteSysUserByUserIdModel>
{
    /// <summary>
    /// 系统用户仓储
    /// </summary>
    public SysUserRep sysUserRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var ids = Parameter.UserIds.Split(",");

        if (ids.Length == 0)
        {
            throw new AggregateException("用户编号不能为空");
        }

        int res = sysUserRep.DeleteSysUserByUserId(Parameter.UserIds);

        Result.Data = res;
    }
}

